
package org.icnmasjid.member.service.impl;

import java.util.List;
import java.util.Map;

import org.icnmasjid.member.dao.RegistrationDao;
import org.icnmasjid.member.model.AfaReg;
import org.icnmasjid.member.model.Registration;
import org.icnmasjid.member.model.SchoolRegistration;
import org.icnmasjid.member.service.RegistrationManager;

public class RegistrationManagerImpl extends BaseManager implements RegistrationManager {
    private RegistrationDao dao;

    /**
     * Set the Dao for communication with the data layer.
     * @param dao
     */
    public void setRegistrationDao(RegistrationDao dao) {
        this.dao = dao;
    }

    /**
     * @see org.icnmasjid.member.service.RegistrationManager#getRegistrations(org.icnmasjid.member.model.Registration)
     */
    public List getRegistrations(final Registration registration) {
        return dao.getRegistrations(registration);
    }

    /**
     * @see org.icnmasjid.member.service.RegistrationManager#getRegistration(String registrationId)
     */
    public Registration getRegistration(final String registrationId) {
        Registration registration = dao.getRegistration(new Integer(registrationId));
        return registration;
    }

    /**
     * @see org.icnmasjid.member.service.RegistrationManager#saveRegistration(Registration registration)
     */
    public void saveRegistration(Registration registration) {
        dao.saveRegistration(registration);
    }

    /**
     * @see org.icnmasjid.member.service.RegistrationManager#removeRegistration(String registrationId)
     */
    public void removeRegistration(final String registrationId) {
        dao.removeRegistration(new Integer(registrationId));
    }

    public Map<String, Integer> getFamilyCheckedInCount(){
    	return dao.getFamilyCheckedInCount();
    }

    public Map<String, Integer> getAmtCollected() {
    	return dao.getAmtCollected();
    }
    
    public SchoolRegistration getExistingSchoolRegistration(
    		SchoolRegistration reg) {
    	return dao.getExistingSchoolRegistration(reg);
    }  
    
    public SchoolRegistration merge(SchoolRegistration sr) {
    	return dao.merge(sr);
    }
    
    @Override
    public List<SchoolRegistration> getExistingSchoolRegistrations(
    		SchoolRegistration reg) {
    	return dao.getExistingSchoolRegistrations(reg);
    }
    
    public List<AfaReg> getAfaRegistrations(AfaReg afaReg) {
    	List<AfaReg> l = dao.getAfaRegistrations(afaReg);
    	return l;
    }

}